extends "../nandaketa-2/nandaketa-2.gd"

func _extInit():
	._extInit()
	lv = 3             #等级的设置
	addSkill("替全队承受40%的非特效伤害，恢复承受伤害40%的生命值", "最强之盾")
var p3 = 1
var storage = 0
func _upS():
	._upS()
	if storage > 0:
		azurHurtChara(self, storage, sys.HurtType.REAL, sys.AtkType.EFF, "最强之盾-伤害结算")
		healCha(self, storage*0.4*p3)
		storage = 0

func _onBattleStart():
	._onBattleStart()
	storage = 0
	for i in getAllChas(2):
		if not i.hasBuff("b_NP_zqzd") and i.id.find("nandaketa") == -1:
			castBuff(i, b_NP_zqzd.new())
	
#最强之盾
class b_NP_zqzd:
	extends "../../../azurlane_ctrl/AzurBuff.gd"
	func _init():
		attInit()
		id = "b_NP_zqzd"
		buffName = "最强之盾"
		dispel = 2
	func _connect():
		masCha.connect("onHurt",self,"_onHurt")
	func _onHurt(atkInfo:AtkInfo):
		if atkInfo.hurtVal > 0 and not atkInfo.isMiss and atkInfo.atkType != sys.AtkType.EFF && not casCha.isDeath and not atkInfo.virtual:
			casCha.storage += atkInfo.hurtVal*0.4
			atkInfo.hurtVal *= 0.6